#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int* LB(int* p, int num, int* len)
{
	*len = 2 * num;
	int*ptr = (int*)malloc(num *sizeof(int)* 2);
	int i = 0;
	for (i = 0; i < num*2; i++)
	{
		if(i<num)
			*(ptr + i) = *(p + i);
		else
		{
			*(ptr + i) = *(p + i - num);
		}
	}
	return ptr;
}
int main()
{
	int arr1[] = {1,2,3};
	int num = sizeof(arr1) / sizeof(arr1[0]);
	int len;
	int* ret = LB(arr1, num, &len);
	for (int i = 0; i < len; i++)
	{
		printf("%d ", *(ret + i));
	}
	free(ret);
	ret = NULL;
	return 0;
}